import LayoutMain from '@/layout';
import setting from '@/setting';
let routePre = setting.routePre;

let pre = 'question_';
const question = {
  path: routePre + '/question',
  name: 'question',
  header: 'question',
  redirect: {
    name: `${pre}list`,
  },
  meta: {
    auth: true
  },
  component: LayoutMain,
  children: [
    {
      path: 'list',
      name: `${pre}list`,
      meta: {
        auth: ['admin-question-list'],
        title: '题库管理',
      },
      component: () => import('@/pages/question/index'),
    },
    {
      path: 'edit',
      name: `${pre}info`,
      meta: {
        auth: ['user-question-info'],
        title: '题库详情',
      },
      component: () => import('@/pages/question/edit'),
    },
  ],
};
pre = 'courseware_'
const courseware = {
  path: routePre + '/courseware',
  name: 'courseware',
  header: 'courseware',
  redirect: {
    name: `${pre}list`,
  },
  meta: {
    auth: true
  },
  component: LayoutMain,
  children: [
    {
      path: 'list',
      name: `${pre}list`,
      meta: {
        auth: ['admin-courseware-list'],
        title: '课件管理',
      },
      component: () => import('@/pages/question/courseware/index'),
    },
    {
      path: 'edit',
      name: `${pre}info`,
      meta: {
        auth: ['user-courseware-info'],
        title: '课件详情',
      },
      component: () => import('@/pages/question/courseware/edit'),
    },
  ],
};
pre = 'course_'
const course = {
  path: routePre + '/course',
  name: 'course',
  header: 'course',
  redirect: {
    name: `${pre}list`,
  },
  meta: {
    auth: true
  },
  component: LayoutMain,
  children: [
    {
      path: 'list',
      name: `${pre}list`,
      meta: {
        auth: ['admin-course-list'],
        title: '课程管理',
      },
      component: () => import('@/pages/question/course/index'),
    },
    {
      path: 'edit',
      name: `${pre}info`,
      meta: {
        auth: ['user-course-info'],
        title: '课程详情',
      },
      component: () => import('@/pages/question/course/edit'),
    },
  ],
};
pre = 'test_'
const test = {
  path: routePre + '/test',
  name: 'test',
  header: 'test',
  redirect: {
    name: `${pre}list`,
  },
  meta: {
    auth: true
  },
  component: LayoutMain,
  children: [
    {
      path: 'list',
      name: `${pre}list`,
      meta: {
        auth: ['admin-test-list'],
        title: '试卷管理',
      },
      component: () => import('@/pages/question/test/index'),
    },
    {
      path: 'edit',
      name: `${pre}info`,
      meta: {
        auth: ['user-test-info'],
        title: '试卷详情',
      },
      component: () => import('@/pages/question/test/addtopic.vue'),
    },
  ],
};

export {question, courseware, course, test};